package org.jivesoftware.smackx.packet;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;
import org.jivesoftware.smack.packet.PacketExtension;

public class DelayInformation
  implements PacketExtension
{
  public static final DateFormat XEP_0091_UTC_FORMAT = new SimpleDateFormat("yyyyMMdd'T'HH:mm:ss");
  private Date stamp;
  private String from;
  private String reason;

  static
  {
    XEP_0091_UTC_FORMAT.setTimeZone(TimeZone.getTimeZone("UTC"));
  }

  public DelayInformation(Date paramDate)
  {
    this.stamp = paramDate;
  }

  public String getFrom()
  {
    return this.from;
  }

  public void setFrom(String paramString)
  {
    this.from = paramString;
  }

  public Date getStamp()
  {
    return this.stamp;
  }

  public String getReason()
  {
    return this.reason;
  }

  public void setReason(String paramString)
  {
    this.reason = paramString;
  }

  public String getElementName()
  {
    return "x";
  }

  public String getNamespace()
  {
    return "jabber:x:delay";
  }

  public String toXML()
  {
    StringBuilder localStringBuilder = new StringBuilder();
    localStringBuilder.append("<").append(getElementName()).append(" xmlns=\"").append(getNamespace()).append("\"");
    localStringBuilder.append(" stamp=\"");
    synchronized (XEP_0091_UTC_FORMAT)
    {
      localStringBuilder.append(XEP_0091_UTC_FORMAT.format(this.stamp));
    }
    localStringBuilder.append("\"");
    if ((this.from != null) && (this.from.length() > 0))
      localStringBuilder.append(" from=\"").append(this.from).append("\"");
    localStringBuilder.append(">");
    if ((this.reason != null) && (this.reason.length() > 0))
      localStringBuilder.append(this.reason);
    localStringBuilder.append("</").append(getElementName()).append(">");
    return localStringBuilder.toString();
  }
}

/* Location:           D:\hygieia\userclient\common\libs\easemobchat_2.1.8.jar
 * Qualified Name:     org.jivesoftware.smackx.packet.DelayInformation
 * JD-Core Version:    0.6.1
 */